<template>
  <view
    class="search-container"
    :style="{ 'background-color': bgColor }"
    @click="searchClickHandler"
  >
    <view class="search-box" :style="{ 'border-radius': radius + 'px' }">
      <uni-icons type="search"></uni-icons>
      <text>搜索</text>
    </view>
  </view>
</template>

<script>
export default {
  name: 'my-search',
  // 自定义组件支持的自定义属性配置
  props: {
    bgColor: {
      type: String,
      default: '#C00000'
    },
    radius: {
      type: Number,
      default: 18 // 单位是px
    }
  },
  data() {
    return {}
  },
  
   methods: {
        // search 点击事件处理函数
        searchClickHandler () {
          this.$emit('click')
        }
      }
}
</script>

<style lang="scss">
.search-container {
  height: 50px;
  // background-color: #c00000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 10px;
  .search-box {
    height: 36px;
    width: 100%;
    background-color: #FFFFFF;
    // border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}
</style>
